﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using com.ClickCricket.dal;

/// <summary>
/// Summary description for BlogService
/// </summary>
/// 
namespace com.ClickCricket.bll
{
    public class BlogService
    {
        private static BlogService instance;

        public static BlogService Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new BlogService();
                }
                return instance;
            }
        }

        private readonly IBlogProvider BlogProvider;

        public BlogService(IBlogProvider BlogProvider)
        {
            this.BlogProvider = BlogProvider;
        }

        public BlogService()
            : this(new BlogLinqProvider())
        {

        }


        public List<Blog> getBlogs()
        {
            return BlogProvider.getBlogs();
        }

        public void SetBlog(Blog blg)
        {
            BlogProvider.SetBlog(blg);
        }
    }
}